#ifndef __LOS_V1_H
#define __LOS_V1_H

#include "my_define.h"


#define LOS_CMD2_ACK		(1<<0)
#define LOS_CMD2_REQUEST	(1<<1)
#define LOS_CMD2_ERR		(1<<2)
#define LOS_CMD2_RESEND		(1<<3)

typedef struct{
	u8 type;
	u8 len;
}LOS_DATA_T;

typedef struct{
	u8 type;
	u8 cmd1;
	u8 cmd2;
	u8 data_num;
	u8 buf[100];
	LOS_DATA_T data_t[10];
	u16 data_len;
	u16 len;
	u8 *p;
}LOS_T;

extern LOS_T Los;


void los_start(u8 type,u8 cmd1,u8 cmd2);
void los_add_u8(u8 type,u8 data1);
void los_add_u16(u8 type,u16 data1);
void los_add_data(u8 type,u8 len,u8 *data1);
void los_stop(void);
void los_check(u8 *buf,u16 len);
u8 los_get_data(u8 *buf,u8 type,u8 *data1);

void los_rxproc(u8 *buf,u16 len);

#endif
